// @ts-nocheck
import React from 'react';
import { ApplyPluginsType, dynamic } from '/home/leonard/bsin-paas/all-in-one/bsin-apps-container/node_modules/@umijs/runtime';
import * as umiExports from './umiExports';
import { plugin } from './plugin';
import LoadingComponent from '@/pages/Loading.tsx';

export function getRoutes() {
  const routes = [
  {
    "path": "/login",
    "component": dynamic({ loader: () => import(/* webpackChunkName: 'p__Login__index' */'@/pages/Login/index'), loading: LoadingComponent}),
    "exact": true
  },
  {
    "path": "/",
    "component": dynamic({ loader: () => import(/* webpackChunkName: 'layouts__index' */'@/layouts/index'), loading: LoadingComponent}),
    "routes": [
      {
        "path": "/",
        "redirect": "/workplace",
        "exact": true
      },
      {
        "name": "workplace",
        "path": "/workplace",
        "component": dynamic({ loader: () => import(/* webpackChunkName: 'p__WorkPlace__index' */'@/pages/WorkPlace/index'), loading: LoadingComponent}),
        "exact": true
      },
      {
        "name": "user",
        "path": "/user",
        "component": dynamic({ loader: () => import(/* webpackChunkName: 'p__User__index' */'@/pages/User/index'), loading: LoadingComponent}),
        "exact": true
      },
      {
        "name": "apps",
        "path": "/apps",
        "component": dynamic({ loader: () => import(/* webpackChunkName: 'p__Apps__index' */'@/pages/Apps/index'), loading: LoadingComponent}),
        "exact": true
      }
    ]
  }
];

  // allow user to extend routes
  plugin.applyPlugins({
    key: 'patchRoutes',
    type: ApplyPluginsType.event,
    args: { routes },
  });

  return routes;
}
